package com.shanzmoo.db.product.service.impl;

import com.shanzmoo.db.product.entity.ProductSpuEntity;
import com.shanzmoo.db.product.entity.dto.ProductSpuActualSaleDTO;
import com.shanzmoo.db.product.entity.dto.ProductSpuDto;
import com.shanzmoo.db.product.entity.vo.ProductQueryVO;
import com.shanzmoo.db.product.entity.vo.ProductVO;
import com.shanzmoo.db.product.mapper.ProductSpuMapper;
import com.shanzmoo.db.product.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 商品spu 服务实现类
 * </p>
 *
 * @author Xueqz
 * @since 2020-12-09
 */
@Service
public class ProductSpuServiceImpl extends ServiceImpl<ProductSpuMapper, ProductSpuEntity> implements IProductSpuService {

    @Override
    public List<ProductVO> getSpuList(ProductQueryVO productQueryVO) {
        return baseMapper.getSpuList(productQueryVO);
    }

    @Override
    public void flagWaitDeleteSku(Integer id, List<Integer> productNoList) {
        baseMapper.flagWaitDeleteSku(id, productNoList);
    }

    @Override
    public Integer getSpuIndex(Integer categoryId, Integer brandId) {
        return baseMapper.getSpuIndex(categoryId, brandId);
    }

    @Override
    public List<ProductSpuDto> getAllSpuDto() {
        return baseMapper.getAllSpuDto();
    }

    @Override
    public List<ProductSpuActualSaleDTO> getSpuActualSales(List<String> spuIds) {
        return baseMapper.getSpuActualSales(spuIds);
    }
}
